fir1(51,[1/100 5/100])什么意思

来源:百度知道 编辑:UC知道 时间:2024/06/24 18:25:26
开始定义f1=10;f2=50;可括号中是什么意思啊。。fir1什么意思。。

fir1:
#include <stdio.h>
#ifdef WIN32
#include <conio.h>
#endif

#define SAMPLE double /* define the type used for data samples */

void clear(int ntaps, SAMPLE z[])
{
int ii;
for (ii = 0; ii < ntaps; ii++) {
z[ii] = 0;
}
}

SAMPLE fir_basic(SAMPLE input, int ntaps, const SAMPLE h[], SAMPLE z[])
{
int ii;
SAMPLE accum;

/* store input at the beginning of the delay line */
z[0] = input;

/* calc FIR */
accum = 0;
for (ii = 0; ii < ntaps; ii++) {
accum += h[ii] * z[ii];
}

/* shift delay line */
for (ii = ntaps - 2; ii >= 0; ii--) {
z[ii + 1] = z[ii];
}

return accum;
}

SAMPLE fir_circular(SAMPLE input, int ntaps, const SAMPLE h[], SAMPLE z[],